package cn.edu.cuit.elena.web.service;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import cn.edu.cuit.elena.trace.Tracer;
import cn.edu.cuit.elena.transaction.controller.TaskMonitor;

public class InitializationServlet
    extends HttpServlet
{

    static volatile TaskMonitor taskMonitor;

    /**
     * 
     */
    private static final long serialVersionUID = 1L;


    public void init( ServletConfig servletConfig )
    {
        if(servletConfig.getInitParameter( "trace" ) != null &&servletConfig.getInitParameter( "trace" ) .equals( "false" ) ){
            Tracer.TraceDisable();
        }
        Tracer.debugTrace( InitializationServlet.class, "Initilizate system!!!!!!!!!!!!", null );
        //Launch taskMonitor
        taskMonitor = TaskMonitor.initilize();
        taskMonitor.start();
    }
}
